home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14204 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  822 b 

  1. Path: user2.mnsinc.com!huang
  2. From: huang@mnsinc.com (Szu-Wen Huang)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Q:Hex to Decimal?
  5. Date: 12 Apr 1996 15:02:07 GMT
  6. Organization: Monumental Network Systems
  7. Message-ID: <4klr9f$29d@news1.mnsinc.com>
  8. References: <DpqLyJ.8Jy@rci.ripco.com>
  9. NNTP-Posting-Host: user.mnsinc.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Martin Ambuhl (mambuhl@ripco.com) wrote:
  13. : Thomas A Cooper <tacooper@tricon.net> in <316D2289.4759@tricon.net>
  14. : asks:
  15.  
  16. : > I'm struggling with the reverse situation, a function to convert an
  17. : >integer into a HEX string. Anybody got any ideas?? Thanks in advance for
  18. : >your help.
  19.  
  20. :         sprintf(target_string,"x",(unsigned)your_integer);
  21.  
  22. Which prints an "x" to your string and formats your hard disk if you
  23. have a mean C compiler.  :)  Try "%x" as the format string.
  24.